bitkeeper revision 1.1159.1.144 (413fafcd5CFNlwHKLUYzorp_LsbEKA)
authorkaf24@freefall.cl.cam.ac.uk <kaf24@freefall.cl.cam.ac.uk>
Thu, 9 Sep 2004 01:20:13 +0000 (01:20 +0000)
committerkaf24@freefall.cl.cam.ac.uk <kaf24@freefall.cl.cam.ac.uk>
Thu, 9 Sep 2004 01:20:13 +0000 (01:20 +0000)
Fix writable-pagetable initialisation.

xen/arch/x86/memory.c

index 57cc589f75fa6ff0ea96c64f5bd7996bd113b45b..640181a6cca3815af8aa06fdb270bc3382901c0a 100644 (file)
@@ -144,7 +144,6 @@ static struct domain *dom_xen, *dom_io;
 void arch_init_memory(void)
 {
     unsigned long mfn;
-    int i;
 
     /*
      * We are rather picky about the layout of 'struct pfn_info'. The
@@ -198,15 +197,6 @@ void arch_init_memory(void)
         frame_table[mfn].u.inuse.type_info  = PGT_gdt_page | 1; /* non-RW */
         frame_table[mfn].u.inuse.domain     = dom_xen;
     }
-
-    vm_assist_info[VMASST_TYPE_writable_pagetables].enable = NULL;
-    vm_assist_info[VMASST_TYPE_writable_pagetables].disable = NULL;
-
-    for ( i = 0; i < smp_num_cpus; i++ )
-    {
-        ptwr_info[i].disconnected_page = (void *)alloc_xenheap_page();
-        ptwr_info[i].writable_page = (void *)alloc_xenheap_page();
-    }
 }
 
 static void __invalidate_shadow_ldt(struct domain *d)
@@ -1876,6 +1866,20 @@ int ptwr_do_page_fault(unsigned long addr)
     return 0;
 }
 
+static __init int ptwr_init(void)
+{
+    int i;
+
+    for ( i = 0; i < smp_num_cpus; i++ )
+    {
+        ptwr_info[i].disconnected_page = (void *)alloc_xenheap_page();
+        ptwr_info[i].writable_page = (void *)alloc_xenheap_page();
+    }
+
+    return 0;
+}
+__initcall(ptwr_init);
+
 #ifndef NDEBUG
 void ptwr_status(void)
 {